package Day7.ZuoYe;

import java.io.*;

//实现文件复制的功能，通过命令行参数，输入一个源文件名，和目标文件夹，复制后文件名保持不变。比如输入
// d:\mydoc\1.jpg, 和f:\img,则复制 d:\mydoc\1.jpg 到 f:\img 目录下
public class Copy {
    public static void main(String[] args) {
        FileInputStream in = null;
        FileOutputStream out = null;
        try {
            in = new FileInputStream("D:\\java课程及作业\\wang\\4567.txt");
            out = new FileOutputStream("D:\\java课程及作业\\wang\\Ceshi1/4567.txt");
            byte[] b = new byte[in.available()];
            in.read(b);
            out.write(b);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
                out.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
